//Resolve http://code.google.com/p/primefaces/issues/detail?id=3996
PrimeFaces.widget.Paginator.prototype.updateUI = function() {  
    //boundaries
    if(this.cfg.page == 0) {
        this.firstLink.removeClass('ui-state-hover').addClass('ui-state-disabled');
        this.prevLink.removeClass('ui-state-hover').addClass('ui-state-disabled');
    }
    else {
        this.firstLink.removeClass('ui-state-disabled');
        this.prevLink.removeClass('ui-state-disabled');
    }
    
    if(this.cfg.page == (this.cfg.pageCount - 1)){
        this.nextLink.removeClass('ui-state-hover').addClass('ui-state-disabled');
        this.endLink.removeClass('ui-state-hover').addClass('ui-state-disabled');
    }
    else {
        this.nextLink.removeClass('ui-state-disabled');
        this.endLink.removeClass('ui-state-disabled');
    }
    
    //current page report
    var startRecord = (this.cfg.page * this.cfg.rows) + 1,
    endRecord = (this.cfg.page * this.cfg.rows) + this.cfg.rows;
    if(this.cfg.rowCount == 0) {
        startRecord = 0;
    }
    if(endRecord > this.cfg.rowCount) {
        endRecord = this.cfg.rowCount;
    }
    
    var text = this.cfg.currentPageTemplate
        .replace("{currentPage}", this.cfg.page + 1)
        .replace("{totalPages}", this.cfg.pageCount)
        .replace("{totalRecords}", this.cfg.rowCount)
        .replace("{startRecord}", startRecord)
        .replace("{endRecord}", endRecord);
    this.currentReport.text(text);
    
    //rows per page dropdown
    this.rppSelect.attr('value', this.cfg.rows);
    
    //jump to page dropdown
    if(this.jtpSelect.length > 0) {
        this.jtpSelect.children().remove();
        
        for(var i=0; i < this.cfg.pageCount; i++) {
            this.jtpSelect.append("<option value=" + i + ">" + (i + 1) + "</option>");
        }
        this.jtpSelect.attr('value', this.cfg.page);
    }
    
    //page links
    this.updatePageLinks();
}